package com.myapp.imp.loading.msg;

import java.io.IOException;

import com.myapp.imp.loading.logical.GC_Loading_RoleLogical;
import com.myapp.msg.ann.MsgDefine;
import com.myapp.msg.base.BaseMsg;
import com.myapp.msg.type.MsgPermission;

import com.myapp.data.beans.RoleBean;

/**
 * 文件名：GC_Loading_RoleMsg.java
 * <p>
 * 功能：读取用户信息
 * <p>
 * 版本：1.0.0
 * <p>
 * 作者：Builderd by AppTools
 * <p>
 */
@MsgDefine(id = 10202, name = "GC_Loading_Role", permission = MsgPermission.AUTHORIZE, logicalClass = GC_Loading_RoleLogical.class)
public class GC_Loading_RoleMsg extends BaseMsg {

	public GC_Loading_RoleMsg(){
	}

	private RoleBean roleBean=null;
	
	//用户信息的get方法
	public RoleBean getRoleBean() {
		return roleBean;
	}

	//用户信息的set方法
	public void setRoleBean(RoleBean roleBean) {
		this.roleBean = roleBean;
	}
	
	@Override
	public void read() throws IOException {}
	
	@Override
	public void write() throws IOException {
		//写入主key
		this.writeLong(roleBean.getId());
		
		//写入用户id
		this.writeLong(roleBean.getUserid());
		
		//写入角色名称
		this.writeString(roleBean.getName());
		
		//写入充值次数
		this.writeShort(roleBean.getChargecount());
		
		//写入充值总额
		this.writeInt(roleBean.getTotalmoeny());
		
		//写入vip等级
		this.writeShort(roleBean.getViplv());
		
		//写入金币
		this.writeInt(roleBean.getGold());
		
		//写入银币
		this.writeInt(roleBean.getSilver());
		
		//写入功勋
		this.writeInt(roleBean.getExploit());
		
		//写入级别
		this.writeShort(roleBean.getLv());
		
		//写入经验
		this.writeInt(roleBean.getExp());
		
		//写入当前地图id
		this.writeShort(roleBean.getMapid());
		
		//写入当前怪物波数
		this.writeShort(roleBean.getWaveid());
		
		//写入当前军令数
		this.writeShort(roleBean.getWrit());
		
	
	}
}
